//
//  SopAddPicViewCell.m
//  DigiOps
//
//  Created by app on 2018/7/31.
//  Copyright © 2018年 俞渊华. All rights reserved.
//

#import "SopAddPicViewCell.h"

@implementation SopAddPicViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    //    [self.sopInfo setBackgroundImage:[UIImage imageNamed:@"sop_info"] forState:UIControlStateNormal];
    //    [self.sopInfo addTarget:self action:@selector(infoClick) forControlEvents:UIControlEventTouchUpInside];
    [self.okButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.closeButton addTarget:self action:@selector(delPic:) forControlEvents:UIControlEventTouchUpInside];
//    [self.notokButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self.okButton setBackgroundColor:[UIColor lightGrayColor]];
//    [self.notokButton setBackgroundColor:[UIColor lightGrayColor]];
//    self.okButton.imageEdgeInsets = UIEdgeInsetsMake(25, (SCREEN_WIDTH- 50)/2, 25, (SCREEN_WIDTH- 50)/2);
    self.imageTake.hidden=YES;
    self.imageTake.contentMode =UIViewContentModeScaleAspectFit;
    self.closeButton.hidden=YES;
    UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognizer)];
    [self addGestureRecognizer:tapGesture];
}
-(void)tapGestureRecognizer{
    UIButton* a=[[UIButton alloc] init];
    a.tag=self.model.ID;
    [self infoClick:a];
}
-(void)infoClick:(UIButton*)sender
{
    if (self.block) {
        self.block(sender);
    }
    //    [sender setBackgroundColor:DGColor];
}
-(void)delPic:(UIButton*)sender
{
    if (self.block1) {
        self.block1(sender);
    }
    //    [sender setBackgroundColor:DGColor];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
+ (SopAddPicViewCell *)cellWithTableView:(UITableView *)tableView {
    static NSString *ID = @"SopAddPicViewCellID";
    
    SopAddPicViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[NSBundle mainBundle] loadNibNamed:@"SopAddPicViewCell" owner:nil options:nil].lastObject;
        cell.backgroundColor=[UIColor whiteColor];
        
    }
    return cell;
}

@end
